import java.lang.reflect.Field;

import junit.framework.JUnit4TestAdapter;
import junit.framework.TestSuite;
import junit.textui.TestRunner;


public class NextDayTest {
	protected static <T, V> V getFieldValue(T obj, String fieldName) {
		Object value = null;
		try {
			Class<T> clazz = (Class<T>) obj.getClass();
			Field field;
			field = clazz.getDeclaredField(fieldName);
			field.setAccessible(true);
			value = field.get(obj);
		} catch (SecurityException e) {
			e.printStackTrace();
		} catch (NoSuchFieldException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		}
		
		return (V) value;
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		TestSuite suit = new TestSuite();
		suit.addTest(new JUnit4TestAdapter(CalendarUnitTest.class));
		suit.addTest(new JUnit4TestAdapter(YearTest.class));
		suit.addTest(new JUnit4TestAdapter(MonthTest.class));
		suit.addTest(new JUnit4TestAdapter(DayTest.class));
		suit.addTest(new JUnit4TestAdapter(DateTest.class));
		TestRunner.run(suit);
	}
}
